package classloader;

public class Ade {
    private static Ade a = new Ade();
    public static int count1 = 0;
    public static int count2;
    private Ade(){
        count1++;
        count2++;
    }
    public static Ade getInstance(){
        return a;
    }
}

/**
 * 准备阶段: Ade a = null; count1 = 0; count2 = 0;
 * 初始化:
 * 1、a = new Ade(); count1 = 1; count2 = 1;
 * 2、count1 = 0;
 * 3、count2 = 1;
 */

class Test1{
    public static void main(String[] args) {
        Ade a = Ade.getInstance();
        System.out.println("count1=" + a.count1);
        System.out.println("count2=" + a.count2);
    }
}
